/*
 * Copyright(c) 2020-2100 万达信息股份有限公司 版权所有
 * WONDERS INFORMATION CO., LTD. ALL RIGHTS RESERVED.
 */

package com.wondersgroup.v2;

/**
 * 加入观察者
 * @author: huym
 * @version: 1.0
 * @date: 2020/12/10
 */
public class Main {
    public static void main(String[] args) {
        Child child = new Child();
        child.wakeUp();
    }
}

class Child{
    private boolean cry = false;
    Dad dad = new Dad();
    public boolean isCry(){
        return this.cry;
    }
    public void wakeUp(){
        cry = true;
        dad.feed();
    }
}

class Dad{
    public void feed(){
        System.out.println("dad feed......");
    }
}